#pragma once

struct screen_info {
    unsigned char orig_x;
    unsigned char orig_y;
    unsigned char unused1[2];
    unsigned short orig_video_page;
    unsigned char orig_video_mode;
    unsigned char orig_video_cols;
    unsigned short orig_video_ega_ax;
    unsigned short orig_video_ega_bx;
    unsigned short orig_video_ega_cx;
    unsigned char orig_video_lines;
};

extern struct screen_info screen_info;

#define ORIG_X            (screen_info.orig_x)
#define ORIG_Y            (screen_info.orig_y)
#define ORIG_VIDEO_PAGE   (screen_info.orig_video_page)
#define ORIG_VIDEO_MODE   (screen_info.orig_video_mode)
#define ORIG_VIDEO_COLS   (screen_info.orig_video_cols)
#define ORIG_VIDEO_EGA_AX (screen_info.orig_video_ega_ax)
#define ORIG_VIDEO_EGA_BX (screen_info.orig_video_ega_bx)
#define ORIG_VIDEO_EGA_CX (screen_info.orig_video_ega_cx)
#define ORIG_VIDEO_LINES  (screen_info.orig_video_lines)

#define VIDEO_TYPE_MDA    0x10 /* Monochrome Text Display */
#define VIDEO_TYPE_CGA    0x11 /* CGA Display */
#define VIDEO_TYPE_EGAM   0x20 /* EGA/VGA in Monochrome Mode */
#define VIDEO_TYPE_EGAC   0x21 /* EGA/VGA in Color Mode */

void con_init();
